package com.sgam.mf.domain.ref;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;

import com.sgam.utils.CustomDateDeserializer;
import com.sgam.utils.CustomDateSerializer;


@Entity
@Table(name = "REF_APPLICATION_PERS_JUR_ADD_FIELDS_PER_SERVICE")
public class RefApplicationPersJurAddFieldsPerService {
	
	@Id
	@Column(name = "id", nullable = true) 
	@GeneratedValue
	private Integer id;
	
	@ManyToOne
	@JoinColumn(name = "ref_services_fk") 
	private RefServices refServices;
	
	@ManyToOne
	@JoinColumn(name = "ref_add_fields_fk") 
	private RefApplicationPersJurAddFields refApplicationPersJurAddFields;
	
	@Column(name = "status", nullable = true) 
	private Integer status;
	
	@Column(name = "updated_by_fk", nullable = true) 
	private Integer updatedByFk;
	
	@JsonSerialize(using = CustomDateSerializer.class)
	@JsonDeserialize(using = CustomDateDeserializer.class)
	@DateTimeFormat(pattern="dd.MM.yyyy")
	@Column(name = "updated_date", nullable = true) 
	private Date updatedDate;
	
	@Column(name = "required") 
	private Integer required;
	
	@Column(name = "item_type") 
	private String itemType;
	
	@Column(name = "group_name") 
	private String groupName;
	
	@Column(name = "show_order") 
	private Integer showOrder;
	
	@Column(name = "datasource") 
	private String datasource;
	
	@Column(name = "show_column") 
	private Integer showColumn;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public RefServices getRefServices() {
		return refServices;
	}

	public void setRefServices(RefServices refServices) {
		this.refServices = refServices;
	}

	public RefApplicationPersJurAddFields getRefApplicationPersJurAddFields() {
		return refApplicationPersJurAddFields;
	}

	public void setRefApplicationPersJurAddFields(
			RefApplicationPersJurAddFields refApplicationPersJurAddFields) {
		this.refApplicationPersJurAddFields = refApplicationPersJurAddFields;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getUpdatedByFk() {
		return updatedByFk;
	}

	public void setUpdatedByFk(Integer updatedByFk) {
		this.updatedByFk = updatedByFk;
	}

	public Date getUpdatedDate() {
		return updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public Integer getRequired() {
		return required;
	}

	public void setRequired(Integer required) {
		this.required = required;
	}

	public String getItemType() {
		return itemType;
	}

	public void setItemType(String itemType) {
		this.itemType = itemType;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public Integer getShowOrder() {
		return showOrder;
	}

	public void setShowOrder(Integer showOrder) {
		this.showOrder = showOrder;
	}

	public String getDatasource() {
		return datasource;
	}

	public void setDatasource(String datasource) {
		this.datasource = datasource;
	}

	public Integer getShowColumn() {
		return showColumn;
	}

	public void setShowColumn(Integer showColumn) {
		this.showColumn = showColumn;
	}

	
	
}
